<template>
  <div>
    <h1>讲师列表页面</h1>
    <h2>组件2接收mitt发送的数据: {{ money }}</h2>
    <h3>首页传过来的数据-------{{ msg }}</h3>
    <slot name="header"></slot>
  </div>
</template>

<script setup>
import { ref, getCurrentInstance } from "vue";
defineProps(["msg"]);
// -------子组件传子组件的方法---------------------
let { proxy } = getCurrentInstance();
let money = ref("");
proxy.$mitt.on("sendMittData", (res) => {
  console.log("组件传过来的数据-----", res);
  money.value = res * 1;
});
</script>
<style lang="scss" scoped></style>
